1. Field of the Invention
The present invention relates to an image processor, and more particularly, to a decoder for HD Photo.
2. Description of the Background Art
Microsoft Corporation has recently proposed HD Photo (or JPEG XR) as a still image file format that offers higher image quality than JPEG while requiring more simple circuit configuration and computation than JPEG 2000.
An encoder for HD Photo includes a color conversion unit, a pre-filter, a frequency transform unit, a quantization unit, a prediction unit, and an encoding unit. The frequency transform unit performs predetermined frequency transform (PCT) on an inputted pixel signal, so as to output frequency data (coefficient data) of highpass (hereinafter “HP”), lowpass (hereinafter “LP”), and direct current (hereinafter “DC”) components. One macroblock having 16 pixels in column×16 pixels in row includes 240 sets of frequency data of HP component, 15 sets of frequency data of LP component, and 1 set of frequency data of DC component for each of luminance Y, chrominance U, and chrominance V.
The quantization unit discards lower (or less significant) data equivalent to the number of digits defined by a quantization coefficient in frequency data of each component inputted from the frequency transform unit, so as to output frequency data after quantization (HP, LP, and DC components).
The encoding unit splits the frequency data of each component inputted from the prediction unit into upper (or more significant) data (Normal Data) in an upper digit range and lower data (Flex Bits) in a lower digit range. Then the encoding unit performs entropy coding on the Normal Data of each component, and output the same, while outputting the Flex Bits of each component without entropy coding.
A decoder for HD Photo includes a color inverse conversion unit, a post-filter, a frequency inverse transform unit, a dequantization unit, an inverse prediction unit and a decoding unit. The decoder performs processing in reverse order to processing by the encoder, so as to decompress pixel signals from the coded frequency data.
The details of HD Photo are disclosed in, for example, “HD Photo—Photographic Still Image File Format”, [online], 7 Nov. 2006, Microsoft Corporation, [searched in the Internet on 10 Oct. 2007], URL: http://www.microsoft.com/whdc/xps/hdphotodpk.mspx>. The details of JPEG XR are disclosed in, for example, “Coding of Still Pictures—JBIG JPEG”, [online], 19 Dec. 2007, ISO/IEC JTC 1/SC 29/WG1 N 4392, [searched in the Internet on 4 Mar. 2008], <URL: http://www.itscj.ipsj.or.jp/sc29/open/29view/29n9026t.doc> or “Coding of Still Pictures—JBIG JPEG”, [online], 14 Sep. 2008, ISO/IEC JTC 1/SC 29/WG1 N 4739, [searched in the Internet on 17 Sep. 2008], <URL:http://www.itscj.ipsj.or.jp/sc29/open/29view/29n9749t.doc>.
FIG. 14 is a block diagram showing a part of a configuration of a decoder for HD Photo. A data stream including a plurality of coded frequency data sets is inputted to processing units 501 and 502. The processing unit 501 decodes Normal Data. The processing unit 502 decodes Flex Bits. A processing unit 503 sorts (Adaptive Scan) 15 sets of data of LP component among data inputted from the processing unit 501. The processing unit 503 also sorts 15 sets of data of HP component among data inputted from the processing unit 501 on a block-by-block basis. Specifically, data is sorted into the order of decreasing frequency of appearance of nonzero data, employing a table showing frequency of appearance of nonzero data. For LP component, there is one table. For HP component, there are two tables, one employed when orientation of prediction of HP component in the macroblock is leftward (hereinafter, “leftward table”), and the other when upward (hereinafter, “upward table”).
The data processed by the processing unit 503 is stored in a memory unit 504. The data processed by the processing unit 502 is stored in the memory unit 505.
A processing unit 506 perform sorting of plural blocks in each sub block, and joining of Normal Data and Flex Bits, on the data read from the memory units 504 and 505.
A processing unit 507 performs inverse prediction on the data inputted from the processing unit 506. The prediction value of DC component is selected from the value of DC component of a macroblock on the left, the value of DC component of a macroblock above, and the average value of the values of DC component of the macroblock on the left and one above, depending on whether or not an edge exist.
The prediction value of LP component is selected from the value of LP component of a macroblock on the left, the value of LP component of a macroblock above, and zero (i.e., prediction is not performed), depending on the orientation of prediction of DC component.
Here, prediction of LP component is performed only on specific data (for YUV444 color space, three sets of data of the top row and three sets of data of the leftmost column within a macroblock). The data necessary for prediction of LP component is stored in a memory unit 508.
The prediction value of HP component is selected from the value of HP component of a block on the left, the value of HP component of a block above, and zero, depending on the value of the above specific data of LP component. Similar to LP component, prediction of HP component is performed only on specific data (for YUV444 color space, three sets of data of the top row and three sets of data of the leftmost column within each block).
When the orientation of prediction of HP component is obtained in the processing unit 507, the processing unit 503 is notified of information on the orientation of prediction as data S100. Based on the data S100, the processing unit 503 selects one of the leftward and upward tables.
FIG. 15 is a timing diagram showing the operation of the configuration in FIG. 14. (A) denotes a period during which data is written to the memory units 504 and 505. (B) denotes a period during which inverse prediction is performed in the processing unit 507. FIG. 15 shows only operation regarding consecutive two macroblocks (0th and first macroblocks).
As indicated in FIG. 15, a time lag T100 occurs between when writing of data LP0 of LP component of the 0th macroblock is completed and when writing of data HP0Y of HP component of the 0th macroblock is started. Similarly, a time lag T101 occurs between when writing of data LP1 of LP component of the first macroblock is completed and when writing of data HP1Y of HP component of the first macroblock is started. This is because the processing unit 503 cannot select one of the leftward and upward tables, until the processing unit 507 completes inverse prediction on the data of LP component and the orientation of prediction of HP component is obtained.
As described above, according to the configuration in FIG. 14, a sorting unit in a preceding stage (processing unit 503) needs to wait for the orientation of prediction of HP component to be obtained in an inverse prediction unit in a subsequent stage (processing unit 507), to start to sort data of HP component. Thus processing of a decoder as a whole is prolonged due to waiting time in the sorting unit.